#!/usr/bin/perl # for syntax highlighting
# CSS-V1

sub mm_portal_report_info_headers($$$$) {
my ($order_by,$portal,$repname,$cpage)=@_;

	my $d;
	if(exists($::ENV{PATH_INFO}) && length($::ENV{PATH_INFO})>1) {
		$d="../images";
	} else {
		$d="images";
	}

	if($order_by eq "?order_by - not defined?") {
		$order_by="rdate";
	}
	if($cpage eq "?cpage - not defined?") {
		$cpage="1";
	}
	#################################################################
	# If the value specified is not recognised then default to name	#
	#################################################################
	my @S=qw(date rdate size rsize);
	if(! grep {$_ eq $order_by} @S) {
		$order_by="rdate";
	}
	my $s="";
	my $s1="<td class=gri_cell width=70%>";
	$s=$s1;

	if($order_by eq "date") {
		my $l=link_to_str("headinglink","Date / Time","portal_report_list","portal=$portal,order_by=rdate,repname=$repname,cpage=$cpage");
		$s.=$l . "&nbsp;&nbsp;<img src=\"$d/down_16.png\"></td>";
	} else {
		my $l=link_to_str("headinglink","Date / Time","portal_report_list","portal=$portal,order_by=date,repname=$repname,cpage=$cpage");
		$s.=$l;
		if($order_by eq "rdate") {
			$s.="&nbsp;&nbsp;<img src=\"$d/up_16.png\">";
		}
		$s.="</td>";
	}

	$s1="<td class=gri_cell-right width=15%>";
	$s.=$s1;
	if($order_by eq "size") {
		my $l=link_to_str("headinglink","Size","portal_report_list","portal=$portal,order_by=rsize,repname=$repname,cpage=$cpage");
		$s.=$l . "&nbsp;&nbsp;<img src=\"$d/down_16.png\"></td>";
	} else {
		my $l=link_to_str("headinglink","Size","portal_report_list","portal=$portal,order_by=size,repname=$repname,cpage=$cpage");
		$s.=$l . "&nbsp;&nbsp;";
		if($order_by eq "rsize") {
			$s.="<img src=\"$d/up_16.png\">";
		}
		$s.="</td>";
	}

	$s1="<td class=gri_cell-right width=15%>Action</td>\n";
	$s.=$s1;
	return $s;
}

# vim:syntax=on:syn=perl:tabstop=4:shiftwidth=4
